From: Hannu Nyman Date: Sat, 14 Jan 2023 08:40:43 +0000 (+0200) Subject: luci-mod-network: Add length restriction to wireless interface name X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=07733a695d88f710db950035ab541fd00c4cd762;p=project%2Fluci.git luci-mod-network: Add length restriction to wireless interface name Based on issue #6101, add a maxlength of 15 chars to the wireless interface's optional name field. Also validate it as uciname. Signed-off-by: Hannu Nyman (cherry picked from commit 0c1be9ae5380d0ac11cccfe152a158eee5bd7125) --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 1c1c1218f6..6f2199f567 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -1159,6 +1159,7 @@ return view.extend({ o = ss.taboption('advanced', form.Value, 'ifname', _('Interface name'), _('Override default interface name')); o.optional = true; + o.datatype = 'and(uciname,maxlength(15))'; o.placeholder = radioNet.getIfname(); if (/^radio\d+\.network/.test(o.placeholder)) o.placeholder = '';